package system

import (
	v2 "gin-admin/handler/v2"
	"gin-admin/middleware"

	"github.com/gin-gonic/gin"
)

func RegisterUserRoutes(group *gin.RouterGroup) {
	userGroup := group.Group("/user")
	handlerApp := v2.NewHandlerApp()
	userGroup.POST("/login", handlerApp.UserHandler.UserLoginHandler)
	userGroup.Use(middleware.AuthorizationMiddleware())
	{
		userGroup.POST("create", handlerApp.UserHandler.CreateUserHandler)
		userGroup.DELETE("delete", handlerApp.UserHandler.DeleteUserByIdHandler)
		userGroup.PUT("/modify", handlerApp.UserHandler.ModifyUserHandler)
		userGroup.GET("/info/:id", handlerApp.UserHandler.GetUserInfoHandler)
		userGroup.GET("/page", handlerApp.UserHandler.GetUserPageHandler)
		userGroup.GET("/list", handlerApp.UserHandler.GetListPageHandler)
	}
}
